package com.baizhi.cmfz.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 上师文章
 *
 * @author zhanglh
 * @date 2019/9/11
 */
public class Article implements Serializable {
    private static final long serialVersionUID = 3697576380662871328L;
    /**
     * 文章id
     */
    private Integer articleId;

    /**
     * 文章标题
     */
    private String articleName;

    /**
     * 文章封面
     */
    private String articleImage;

    /**
     * 文章内容
     */
    private String articleContent;

    /**
     * 发布时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime articleDate;

    private int guruId;
    private String guruNickname;

    private Integer articleStatus;

    public Article() {}

    public Integer getArticleId() {return this.articleId;}

    public String getArticleName() {return this.articleName;}

    public String getArticleImage() {return this.articleImage;}

    public String getArticleContent() {return this.articleContent;}

    public LocalDateTime getArticleDate() {return this.articleDate;}

    public int getGuruId() {return this.guruId;}

    public String getGuruNickname() {return this.guruNickname;}

    public Integer getArticleStatus() {return this.articleStatus;}

    public void setArticleId(Integer articleId) {this.articleId = articleId; }

    public void setArticleName(String articleName) {this.articleName = articleName; }

    public void setArticleImage(String articleImage) {this.articleImage = articleImage; }

    public void setArticleContent(String articleContent) {this.articleContent = articleContent; }

    public void setArticleDate(LocalDateTime articleDate) {this.articleDate = articleDate; }

    public void setGuruId(int guruId) {this.guruId = guruId; }

    public void setGuruNickname(String guruNickname) {this.guruNickname = guruNickname; }

    public void setArticleStatus(Integer articleStatus) {this.articleStatus = articleStatus; }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof Article)) return false;
        final Article other = (Article) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$articleId = this.getArticleId();
        final Object other$articleId = other.getArticleId();
        if (this$articleId == null ? other$articleId != null : !this$articleId.equals(other$articleId)) return false;
        final Object this$articleName = this.getArticleName();
        final Object other$articleName = other.getArticleName();
        if (this$articleName == null ? other$articleName != null : !this$articleName.equals(other$articleName))
            return false;
        final Object this$articleImage = this.getArticleImage();
        final Object other$articleImage = other.getArticleImage();
        if (this$articleImage == null ? other$articleImage != null : !this$articleImage.equals(other$articleImage))
            return false;
        final Object this$articleContent = this.getArticleContent();
        final Object other$articleContent = other.getArticleContent();
        if (this$articleContent == null ? other$articleContent != null :
                !this$articleContent.equals(other$articleContent))
            return false;
        final Object this$articleDate = this.getArticleDate();
        final Object other$articleDate = other.getArticleDate();
        if (this$articleDate == null ? other$articleDate != null : !this$articleDate.equals(other$articleDate))
            return false;
        if (this.getGuruId() != other.getGuruId()) return false;
        final Object this$guruNickname = this.getGuruNickname();
        final Object other$guruNickname = other.getGuruNickname();
        if (this$guruNickname == null ? other$guruNickname != null : !this$guruNickname.equals(other$guruNickname))
            return false;
        final Object this$articleStatus = this.getArticleStatus();
        final Object other$articleStatus = other.getArticleStatus();
        if (this$articleStatus == null ? other$articleStatus != null : !this$articleStatus.equals(other$articleStatus))
            return false;
        return true;
    }

    protected boolean canEqual(final Object other) {return other instanceof Article;}

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $articleId = this.getArticleId();
        result = result * PRIME + ($articleId == null ? 43 : $articleId.hashCode());
        final Object $articleName = this.getArticleName();
        result = result * PRIME + ($articleName == null ? 43 : $articleName.hashCode());
        final Object $articleImage = this.getArticleImage();
        result = result * PRIME + ($articleImage == null ? 43 : $articleImage.hashCode());
        final Object $articleContent = this.getArticleContent();
        result = result * PRIME + ($articleContent == null ? 43 : $articleContent.hashCode());
        final Object $articleDate = this.getArticleDate();
        result = result * PRIME + ($articleDate == null ? 43 : $articleDate.hashCode());
        result = result * PRIME + this.getGuruId();
        final Object $guruNickname = this.getGuruNickname();
        result = result * PRIME + ($guruNickname == null ? 43 : $guruNickname.hashCode());
        final Object $articleStatus = this.getArticleStatus();
        result = result * PRIME + ($articleStatus == null ? 43 : $articleStatus.hashCode());
        return result;
    }

    public String toString() {return "Article(articleId=" + this.getArticleId() + ", articleName=" + this.getArticleName() + ", articleImage=" + this.getArticleImage() + ", articleContent=" + this.getArticleContent() + ", articleDate=" + this.getArticleDate() + ", guruId=" + this.getGuruId() + ", guruNickname=" + this.getGuruNickname() + ", articleStatus=" + this.getArticleStatus() + ")";}
}

